import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询农户列表
export function listFarmer(query) {
  return request({
    url: '/ap/farmer/list',
    method: 'get',
    params: query
  })
}

// 查询农户详细
export function getFarmer(id) {
  return request({
    url: '/ap/farmer/' + parseStrEmpty(id),
    method: 'get'
  })
}

// 新增农户
export function addFarmer(data) {
  return request({
    url: '/ap/farmer',
    method: 'post',
    data: data
  })
}

// 修改农户
export function updateFarmer(data) {
  return request({
    url: '/ap/farmer',
    method: 'put',
    data: data
  })
}

// 删除农户
export function delFarmer(id) {
  return request({
    url: '/ap/farmer/' + id,
    method: 'delete'
  })
}
